﻿@model ContactManagement.Models.DynamicData.EditModel
@{
    ViewBag.Title = GlobalResources.PageTitles.EditDynamicDataTypeRESX + ": " + Model.CurrentDynamicDataType.Name;
}

<div class="span12">
    <h2>@GlobalResources.PageTitles.EditDynamicDataTypeRESX: @Model.CurrentDynamicDataType.Name (@Model.CurrentDynamicDataType.GetDynamicDataTypeName())</h2>
    <hr />
</div>
<div class="span12">
    @using (Html.BeginForm(EActionDynamicData.Boolean.ToString(), EControllers.DynamicData.ToString(), FormMethod.Post, new { @class = "form-horizontal" }))
    {
        <fieldset>
            @Html.MyValidationSummary()
            @Html.ShowCustomMessage()

            <div class="control-group">
                @Html.LabelFor(model => model.Name, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Name)
                    @Html.ValidationMessageFor(model => model.Name)
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.DynamicDataTypeCategories, new { @class = "control-label" })

                <div class="controls">
                    @Html.DropDownListFor(model => model.DynamicDataTypeCategoryId, Model.DynamicDataTypeCategories, GlobalResources.GlobalStrings.PleaseSelectItemsRESX)
                    @Html.ValidationMessageFor(model => model.DynamicDataTypeCategoryId)
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.IsVisible, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.IsVisible)
                    @Html.ValidationMessageFor(model => model.IsVisible)
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.SortId, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.SortId)
                    @Html.ValidationMessageFor(model => model.SortId)
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.CustomCssClass, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.CustomCssClass)
                    @Html.ValidationMessageFor(model => model.CustomCssClass)
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.IsFilterable, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.IsFilterable)
                    @Html.ValidationMessageFor(model => model.IsFilterable)
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.Description, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Description)
                    @Html.ValidationMessageFor(model => model.Description)
                </div>
            </div>

            <div class="form-actions">
                <input class="btn btn-primary" type="submit" value="@GlobalResources.Navigation.SaveChangesRESX" />
            </div>
        </fieldset>
    }
</div>

<div class="span12">
    <div class="well">
        @Html.ActionLink(@GlobalResources.Navigation.BackToListRESX, EActionDynamicData.DynamicDataTypesList.ToString(), null, new { @class = "btn btn-small", data_icon = "icon-arrow-left" })
        @Html.ActionLink(@GlobalResources.Navigation.DynamicDataEditGroupRightsRESX, EActionDynamicData.EditGroupRights.ToString(), new { id = Model.CurrentDynamicDataType.ID }, new { @class = "btn btn-small" })
    </div>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
